{% extends 'base.html' %}

{% block title %}
往事如烟的博客
{% endblock %}

{% block content %}
    <div class="content-wrap">
    <div id="content" class="content">

    <section id="posts" class="posts-expand">

        {% for blog in all_blog.object_list %}

            <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article" style="opacity: 1; display: block; transform: translateY(0px);">

        <header class="post-header">
            <h1 class="post-title" itemprop="name headline">
                <a class="post-title-link" href="{% url 'blog_id' blog.id %}" itemprop="url">
                  {{ blog.title }}
                </a>
            </h1>

            <div class="post-meta">
            <span class="post-time">

                <span class="post-meta-item-icon">
                    <i class="fa fa-calendar-o"></i>
                </span>

                <span class="post-meta-item-text">发表于</span>

                <time title="Post created" itemprop="dateCreated datePublished" datetime="#">
                {{ blog.create_time|date:'Y-m-d' }}
                </time>

            </span>

            <span class="post-category">
                <span class="post-meta-divider">|</span>

                <span class="post-meta-item-icon">
                    <i class="fa fa-folder-o"></i>
                </span>

                <span class="post-meta-item-text">分类于</span>

                <span itemprop="about" itemscope="" itemtype="http://schema.org/Thing">
                    <a href="{% url 'category_name' blog.category.name %}" itemprop="url" rel="index">
                        <span itemprop="name">{{ blog.category.name }}</span>
                    </a>
                </span>

            </span>

        </div>
        </header>


        <div class="post-body" itemprop="articleBody">

            {{ blog.content|safe }}

          <!--noindex-->
            <div class="post-button text-center">
                <a class="btn" href="{% url 'blog_id' blog.id %}" rel="contents">
                  阅读全文 »
                </a>
            </div>
          <!--/noindex-->


        </div>

        <footer class="post-footer">
            <div class="post-eof"></div>
        </footer>
    </article>

        {% endfor %}



  </section>

          <!--分页展示-->
<nav class="pagination">
    <div class="pageturn">
        <ul class="pagelist">

            {% if all_blog.has_previous %}
                <li class="long"><a href="?{{ all_blog.previous_page_number.querystring }}">上一页</a></li>
            {% endif %}

            {% for page in all_blog.pages %}
            {% if page %}
                {% ifequal page all_blog.number %}
                    <li class="active"><a href="?{{ page.querystring }}">{{ page }}</a></li>
                {% else %}
                     <li><a href="?{{ page.querystring }}" class="page">{{ page }}</a></li>
                {% endifequal %}
            {% else %}
                <li class="none"><a href="">...</a></li>
            {% endif %}
            {% endfor %}
            {% if all_blog.has_next %}
                <li class="long"><a href="?{{ all_blog.next_page_number.querystring }}">下一页</a></li>
            {% endif %}

        </ul>
    </div>
</nav>


    </div>

</div>
{% endblock %}